package com.blog.cloud.auth;

import com.alibaba.fastjson2.JSONObject;
import com.blog.cloud.oss.dynamic.properties.TestDemo;
import com.blog.cloud.security.utils.JwtTokenUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;

@SpringBootTest
public class AuthApplicationTest {

    @Autowired
    private ObjectMapper objectMapper;

    @Getter
    @Setter
    @Accessors(chain = true)
    private static class Demo {
        private String name;
        private Date demoTime;
    }

    @Test
    public void getToken() {
        String token = JwtTokenUtil.createToken(123456L);
        System.out.println(token);
    }

    @Autowired
    private TestDemo testDemo;
    @Test
    public void testDemo1() {
        String s = JSONObject.toJSONString(testDemo);
        System.out.println(s);
    }

}
